import { useStore } from "@/stores/store"

const getPicture = (pictureName:string):string => new URL('../images',import.meta.url).href+'/'+pictureName
const plusZero = (n:number) => n <10? '0'+n : n
const getLocalStringDateTime = (normalDate:Date):string => {
    const d = new Date(normalDate)
    return `${d.getFullYear()}-${plusZero(d.getDate()+1)}-${plusZero(d.getDate())} ${plusZero(d.getHours())}:${plusZero(d.getSeconds())}`
}
const getLocalStringDate = (normalDate:Date):string =>{
    const d = new Date(normalDate)
    return `${d.getFullYear()}-${plusZero(d.getMonth()+1)}-${plusZero(d.getDate())}`
}
const getStore = () => useStore()
export {
    getPicture,getLocalStringDateTime,getLocalStringDate,getStore
}